intersect
Type
function
Summary
Returns true if two objects overlap, false otherwise.
Syntax
intersect(<object>, <object> [, <threshold>] )
Description
Use the intersect function to determine whether one object obscures part of another object, or whether one object is over another object.
If both objects are stacks or cards, the intersect function returns true if the stack window|stack windows overlap.
The intersect function uses screen coordinates for stacks and cards, and window coordinates for controls. This means that if one object is a stack or card and the other is a control, the intersect function does not return a reliable result.
Parameters
Name | Type | Description |
---|---|---|
object | an object reference. | |
threshold | enum | The amount of transparency that pixels in the objects must have in order to be counted during the intersect calculation. Alternative (readable) theshold options |
Examples
intersect(field "Comment",the selectedField)
if intersect(button "target", button "crosshairs") then flashScreen
if intersect(graphic "spaceship", graphic "asteroid", "opaque pixels") then endGame
answer intersect(image "gradient", grc "solid",125)
Related
glossary: control, relative coordinates, return, stack window, object
property: layer
constant: return
control structure: function
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile